package com.example.zhaojianxu.signin.signIn.sign.view

import android.os.Bundle
import android.util.Log
import android.view.View
import com.example.zhaojianxu.signin.R
import com.example.zhaojianxu.signin.bean.BaseActivity
import com.example.zhaojianxu.signin.signIn.contsance.Constance
import com.example.zhaojianxu.signin.common.util.LocationUtil
import com.example.zhaojianxu.signin.common.util.ToastUtil
import kotlinx.android.synthetic.main.activity_sign_detail.*
import kotlinx.android.synthetic.main.common_title_bar.*

class SignDetailActivity : BaseActivity() {

    override fun initView() {
        common_setting.visibility = View.GONE
        common_back.setOnClickListener {
            finish()
        }

        sign_detail_sign.setOnClickListener {
            val location = LocationUtil.getGPSLocation(this)

            if (location != null) {
                Log.d(Constance.TAG, "时间：" + location.time)
                Log.d(Constance.TAG, "经度：" + location.longitude)
                Log.d(Constance.TAG, "纬度：" + location.latitude)
                Log.d(Constance.TAG, "海拔：" + location.altitude)
                finish()
            } else {
                ToastUtil.instance.showToast(this, "签到失败！")
            }
        }
    }

    override fun initData() {
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_sign_detail)

    }

}
